﻿Public Class ClsPhieuPhat
    Public Shared Function TaoPhieu(ByVal MaPhieu As String, ByVal MaDG As String, ByVal MaNV As String, ByVal NgayLap As Date, ByVal GhiCHu As String) As Boolean
        Return db.Query("insert into PhieuPhat (MaPhieuPhat,MaNV,MaDG,NgayLap,GhiChu) values ('" & MaPhieu & "','" & MaDG & "','" & MaNV & "','" & NgayLap.ToString("MM/dd/yyyy)") & "',N'" & GhiCHu & "')")
    End Function
    Public Shared Function ThemChiTiet(ByVal MaPhieu As String, ByVal LyDo As String, ByVal TienPhat As Double)
        Return db.Query("insert into PhieuPhatChiTiet(MaPhieuPhat,LyDo,TienPhat) values ('" & MaPhieu & "',N'" & LyDo & "'," & TienPhat & ")")
    End Function
    Public Shared Function TonTaiMaPhieu(ByVal MaPhieu As String) As Boolean
        Return db.QueryTable("select * from PhieuPhat where MaPhieuPhat='" & MaPhieu & "'").Rows.Count > 0
    End Function
End Class
